<template>
	<u-navbar :leftIcon="backIconName" :title="title" :custom-back="backFunction" leftIconColor="#ffffff"
		:titleStyle="titleStyle" :leftIconSize="22" :border-bottom="false" :bgColor="bgColor"
		@leftClick="goBack"></u-navbar>
</template>

<script>
	export default {
		name: 'navbar',
		props: {
			// 返回图标名称
			backIconName: {
				type: String,
				default: ''
			},
			// 标题
			title: {
				type: String,
				default: ''
			},
			titleStyle: {
				type: Object,
				default: null
			},
			// 自定义返回
			backFunction: {
				type: Function,
				default: null
			},
			bgColor: {
				type: String,
				default: '#2b65da'
			},
			delta: {
				type: Number,
				default: 1
			},
		},
		methods: {
			goBack() {
				uni.navigateBack({
					delta: this.delta
				})
			}
		}
	};
</script>

<style></style>